<ul class="layui-nav layui-bg-cyan" lay-filter="">
    {if $Think.session.business.successively == 2}
        <li class="layui-nav-item"><a href="{:url('business/postpayment/index')}">首页</a> </li>
    {elseif $Think.session.business.successively == 1 /}
        <li class="layui-nav-item"><a href="{:url('business/index/index')}">首页</a> </li>
    {/if}
    <li class="layui-nav-item"><a href="{:url('business/goods/index')}">查看商品</a></li>
    {if $Think.session.business.successively == 2}
        <li class="layui-nav-item"><a href="{:url('business/order/index')}">订单记录</a></li>
        <li class="layui-nav-item"><a href="{:url('business/apply/index')}">申请结算记录</a></li>
    {/if}
    <li class="layui-nav-item"><a href="{:url('business/mail/index')}">邮寄</a></li>
    <li class="layui-nav-item" style="float: right">
        <button type="button" style="background-color: #2F4056" class="layui-btn" id="uploads">
            <i class="layui-icon"  style="font-size: 15px"><img id='image' src="__ROOT__\{$Think.session.business.logo}" class="" style="width: 30px;height: 30px;margin-right: 10px;border-radius: 50%;">你好!{$Think.session.business.name}</i>
        </button>
        <input type="file" name="file" id="up" style="display: none" class="layui-upload-file">
        <dl class="layui-nav-child">
            <dd><a href="javascript:;" onclick="exit()">退出</a></dd>
            <dd><a href="javascript:;" onclick="updatepass()">修改密码</a></dd>
            <dd><a href="javascript:;" onclick="edit()">修改个人信息</a></dd>
        </dl>
    </li>
</ul>
<script>
    //初始化导航
    layui.use('element', function(){
        layui.element;
    });
    //退出
    function exit() {
        layer.confirm('你确定要退出吗',{bnt:['退出','取消']},
            function () {
                window.location.href = "{:url('business/login/outlogin')}";
            }
        );
    }
    //修改密码
    function updatepass() {
        layer.open({
            type:2,
            title:"修改密码",
            anim:2,
            area: ['550px', '500px'],
            content:"{:url('business/common/pass')}"
        });
    }
    //修改个人信息
    function edit() {
        layer.open({
            type:2,
            title:"修改个人信息",
            anim:2,
            area: ['550px', '500px'],
            content:"{:url('business/common/edit')}"
        });
    }
    //更换头像
    layui.use('upload', function(){
        var upload = layui.upload;
        upload.render({
            elem: '#uploads', //绑定元素,
            url: "{:url('business/common/updatelogo')}", //上传接口
            done: function(res){
                if(res.error){
                    layer.alert(res.error);
                }else{
                    $("#image").attr('src',"__ROOT__\\"+res.image);
                }
            }
        });
    });

</script>